//
//  ActivityView.m
//  easyTaxi
//
//  Created by ellenpage on 13-7-16.
//  Copyright (c) 2013年 ellenpage. All rights reserved.
//

#import "ActivityView.h"
#import "Constant.h"
#import "PassValueClass.h"

#define kUrl @"http://m.ehave.cn/Etaxihelp/default.aspx?"

@interface ActivityView ()

@property (strong, nonatomic) IBOutlet UIWebView *webView;

- (IBAction)goBack;

@end

@implementation ActivityView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        self = [[[NSBundle mainBundle] loadNibNamed:@"ActivityView" owner:self options:nil] objectAtIndex:0];

        [self loadView];
    }
    return self;
}

- (void)loadView
{
    self.frame = CGRectMake(0, 0, 320, iP5 ? 548 :460);
    
    self.webView.frame = CGRectMake(0, 44, 320, iP5 ? 524 :436);
    
    NSString *areacode = [PassValueClass sharedIntance].areaCode;
    NSString *imsiStr  = [PassValueClass sharedIntance].IMSIStr;
    
    NSString *urlStr   = [kUrl stringByAppendingFormat:@"areacode=%@&type=0&imsi=%@",areacode,imsiStr];
    NSLog(@"%@",urlStr);
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlStr]]];
    [self addSubview:self.webView];
}

- (IBAction)goBack
{
    [self removeFromSuperview];
}
@end
